$(function(){
    //alert()
    $.ajax({
        type: "get",
        url: "http://193.112.55.79:9090/api/getbaicaijiatitle",
        dataType: "json",
        success: function (response) {
            //console.log(response);
           // console.log(response.result);
            var html= template('mmbtp',response.result);
            $("nav>ul").html(html);
        //    console.log(html);

        }
    });
    $.ajax({
        type: "get",
        url: "http://193.112.55.79:9090/api/getbaicaijiaproduct",
        data: {
            titleid : 1
        },
        dataType: "json",
        success: function (response) {
         //   console.log(response);
            //console.log()
            var html= template('bailist',response.result);
            $(".main>ul").html(html);
          // console.log(html);
        }
    });



    /* 获取id */
    $(".nav").on('click','a', function(){
        //alert();
        $res =$(this).attr('titleId');
        //console.log($res);
        $.ajax({
            type: "get",
            url: "http://193.112.55.79:9090/api/getbaicaijiaproduct",
            data: {
                titleid : $res
            },
            dataType: "json",
            success: function (response) {
             //   console.log(response);
                //console.log()
                var html= template('bailist',response.result);
                $(".main>ul").html(html);
              // console.log(html);
            }
        });
    
    })


    /* =============回到顶部============= */
    $(".move").on('click',function(){
        // alert();
        $('body,html').animate({ scrollTop: 0 }, 800)
    })


})